<?PHP



$con=mysqli_connect("localhost","root","","bd_news");
// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

	$id_del = mysqli_real_escape_string($con, $_GET['id_del']);
	

$sql="DELETE FROM news WHERE id_news = $id_del;";

if (!mysqli_query($con,$sql)) {
  die('Error: ' . mysqli_error($con));
}
//DELETE FROM `news_tags` WHERE `ID_NEWS`=20
$sql="DELETE FROM news_tags WHERE ID_NEWS= $id_del;";

if (!mysqli_query($con,$sql)) {
  die('Error: ' . mysqli_error($con));
}



mysqli_close($con);	

echo "<meta http-equiv='refresh' content='0;url=./newsmyadm.php'>";	
?>			